package org.example.model;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

@Setter
public class Tess4JWidget extends Widget {

    private String text;
    private double x1;
    private double x2;
    private double y1;
    private double y2;

    @Override
    public BigDecimal getHeight() {
        return BigDecimal.valueOf(y2).subtract(BigDecimal.valueOf(y1));
    }

    @Override
    public BigDecimal getWidth() {
        return BigDecimal.valueOf(x2).subtract(BigDecimal.valueOf(x1));
    }

    @Override
    public BigDecimal getX() {
        return BigDecimal.valueOf(x1);
    }

    @Override
    public BigDecimal getY() {
        return BigDecimal.valueOf(y1);
    }

    @Override
    public String getText() {
        return text;
    }

    @Override
    public BigDecimal getConfidence() {
        return super.getConfidence();
    }
}
